        public class Student{        
        private String name;  
        private int id;
        private int javaGrade;  
        
        public Student(String name, int id, int javaGrade){  
            this.id = id; 
            this.name = name; 
            this.javaGrade = javaGrade; 
        }  
        public void setName(String name){  
            this.name = name;  
        }  
        public void setId(int id){  
            this.id = id;  
        } 
        public void setJavaGrade(int javaGrade){
            this.javaGrade = javaGrade;
        } 
        public String getName(){  
            return this.name;  
        }  
        public int getId(){  
            return this.id;  
        }
        public int getJavaGrade(){
            return this.javaGrade; 
        }
  
        @Override  
        public boolean equals(Object obj) {  
            if(this == obj){  
                return true;  
            }  
            if(obj == null){  
                return false;  
            }  
            if(!(obj instanceof Student)){  
                return false;  
            }  
            final Student student = (Student)obj;
            if(!this.getName().equals(student.getName())){  
                return false;  
            }  
            if(this.getId() != student.getId()){  
                return false;  
            } 
            if(this.getJavaGrade() !=student.getJavaGrade()){
                return false; 
            } 
            return true;  
        }  
    public static void main(String[] args){  
        Student stu1 = new Student("Rose", 17,10);
        Student stu2 = new Student("Helen", 18,7);
        Student stu3 = new Student("Rose", 17,10);
        if(stu1.equals(stu2)){  
            System.out.println("stu1.equals stu2");  
        }  
        if(stu1.equals(stu3)){
            System.out.println("stu1.equals stu3");
        }
  
    }
}   
